<?php

class Ligature extends Controller {

    function Ligature() {
    	include("ligature/ligature_constructor.php");
    }

    function index() {
        $this->home();
    }

    /**
     *	Displays the 'Create or Edit Post' page and processes its input.
     *	@param string $postId 
     */
    function editPost( $postId = null ) {
    	if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    		// Form 'newPostForm'
    		if ($this->input->post('clickframesFormId') == 'editPost-newPostForm') {
       			include("ligature/editPost_form_newPostForm.php");
       		}


    	}

    	include("ligature/editPost.php");
    }

    /**
     *	Displays the 'Home' page and processes its input.
     *	@param string $currentPage Indicates which page of posts to display. Default is 1.
     */
    function home( $currentPage = null ) {

    	include("ligature/home.php");
    }

    /**
     *	Displays the 'Log Out' page and processes its input.
     */
    function logout() {

    	include("ligature/logout.php");
    }

    /**
     *	Displays the 'Post' page and processes its input.
     *	@param string $slug 
     */
    function post( $slug = null ) {
    	if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    		// Form 'newCommentForm'
    		if ($this->input->post('clickframesFormId') == 'post-newCommentForm') {
       			include("ligature/post_form_newCommentForm.php");
       		}


    	}

    	include("ligature/post.php");
    }

    /**
     *	Displays the 'Post Short URL' page and processes its input.
     *	@param string $postId 
     */
    function p( $postId = null ) {
    	if ($_SERVER['REQUEST_METHOD'] == 'POST') {

			// Action 'Find post by ID'
			if ($this->input->post('clickframesFormId') == 'p-action-findPost') {
				include("ligature/p_action_findPost.php");
			}
    	}

    	include("ligature/p.php");
    }

    /**
     *	Displays the 'Posts RSS Feed' page and processes its input.
     */
    function feed() {

    	include("ligature/feed.php");
    }

    /**
     *	Displays the 'Refresh Tweets' page and processes its input.
     */
    function refresh() {

    	include("ligature/refresh.php");
    }

    /**
     *	Displays the 'Search' page and processes its input.
     *	@param string $searchTerms Free text search terms
     *	@param string $currentPage Indicates which page of posts to display. Default is 1.
     */
    function search( $searchTerms = null, $currentPage = null ) {

    	include("ligature/search.php");
    }

    /**
     *	Displays the 'Sorry!' page and processes its input.
     */
    function error() {

    	include("ligature/error.php");
    }

    /**
     *	Displays the 'Twitter OAuth Callback' page and processes its input.
     */
    function callback() {
    	if ($_SERVER['REQUEST_METHOD'] == 'POST') {

			// Action 'Process authentication response'
			if ($this->input->post('clickframesFormId') == 'callback-action-processResponse') {
				include("ligature/callback_action_processResponse.php");
			}
    	}

    	include("ligature/callback.php");
    }

    /**
     *	Displays the 'Twitter OAuth Initiation' page and processes its input.
     *	@param string $mode If mode is set to 'forceLogin', Twitter will require the user to log in under another address.
     */
    function auth( $mode = null ) {
    	if ($_SERVER['REQUEST_METHOD'] == 'POST') {

			// Action 'Initiate OAuth process with Twitter'
			if ($this->input->post('clickframesFormId') == 'auth-action-intiateOAuth') {
				include("ligature/auth_action_intiateOAuth.php");
			}
    	}

    	include("ligature/auth.php");
    }

}

/* clickframes::version=4002516790::clickframes */
?>